﻿using GISforTT_API;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Windows;
using System.Windows.Markup;

namespace GISforTT_Test
{
    
    
    /// <summary>
    ///This is a test class for CornerMenuTest and is intended
    ///to contain all CornerMenuTest Unit Tests
    ///</summary>
    [TestClass()]
    public class CornerMenuTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for CornerMenu Constructor
        ///</summary>
        [TestMethod()]
        public void CornerMenuConstructorTest()
        {
            CornerMenu.CornerMenuLocation menuLocation = new CornerMenu.CornerMenuLocation(); // TODO: Initialize to an appropriate value
            CornerMenu target = new CornerMenu(menuLocation);
            Assert.Inconclusive("TODO: Implement code to verify target");
        }


        /// <summary>
        ///A test for ToggleMenuState
        ///</summary>
        [TestMethod()]
        [DeploymentItem("GISforTT_API.dll")]
        public void ToggleMenuStateTest()
        {
            CornerMenu_Accessor target = new CornerMenu_Accessor(CornerMenu.CornerMenuLocation.BottomLeft);
            target.ToggleMenuState();

            if (target.ExpandedMenu.Visibility == Visibility.Hidden)
            {
                Assert.AreEqual(target.CollapsedMenu.Visibility, Visibility.Hidden);
                Assert.AreEqual(target.ExpandedMenu.Visibility, Visibility.Visible);                
            }
            else
            {
                Assert.AreEqual(target.CollapsedMenu.Visibility, Visibility.Visible);
                Assert.AreEqual(target.ExpandedMenu.Visibility, Visibility.Hidden);                
            }            
        }

        /// <summary>
        ///A test for Location
        ///</summary>
        [TestMethod()]
        public void LocationTest()
        {
            CornerMenu.CornerMenuLocation expected = CornerMenu.CornerMenuLocation.BottomRight;
            CornerMenu target = new CornerMenu(expected);            
            CornerMenu.CornerMenuLocation actual;
            target.Location = expected;
            actual = target.Location;
            Assert.AreEqual(expected, actual);            
        }
    }
}
